package part19_状态模式_抽奖;

/**不能抽奖状态
 * @ClassName: NoRaffleState
 * @Author: AllenSun
 * @Date: 2020/3/9 21:33
 */
public class NoRaffleState extends State {
    RaffleActivity activity;

    public NoRaffleState(RaffleActivity activity) {
        this.activity = activity;
    }

    @Override
    public void deductMoney() {
        System.out.println("扣除50积分，您可以抽奖了");
        activity.setState(activity.getCanRaffleState());
    }

    @Override
    public boolean raffle() {
        System.out.println("扣了积分才能抽奖");
        return false;
    }

    @Override
    public void despendePrize() {
        System.out.println("不能发放奖品");
    }
}
